UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9XA6CnaBPpvcyHXKwwNY+r+MrFpDn8FjItP5MjtXjBo='
WHERE
key_id = '145489db4e24ace9ffba6af026517827dd9bbd4f92b53e936f06396270b8c761'
AND (
token = '9XA6CnaBPpvcyHXKwwNY+r+MrFpDn8FjItP5MjtXjBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)