UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TQZWDaC0NNT2VPxrryl5yVanY0cJJfuOw6Q2AiOLLf0='
WHERE
key_id = '9410535c003d98467a7e42b6dda25e7654db33c9d5363a795a2dd264c8a0f2ed'
AND (
token = 'TQZWDaC0NNT2VPxrryl5yVanY0cJJfuOw6Q2AiOLLf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)