UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W5ISyXICA9uNoEak4h/qnVpACjwD+LjqzWD60gLZeY4='
WHERE
key_id = '468878369111ba9cbc3d81c602f30b1614d1c7d7315d96988d90c13ef2fbaed7'
AND (
token = 'W5ISyXICA9uNoEak4h/qnVpACjwD+LjqzWD60gLZeY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)