UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7rs4/eYTpU8Wv6trLQuYJxMyW3zQmhkAeZcLct61uJo='
WHERE
key_id = 'a866930fff10b051caa1b55ba4093bd4a9898566c51c163d7153c62ad05cfa07'
AND (
token = '7rs4/eYTpU8Wv6trLQuYJxMyW3zQmhkAeZcLct61uJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)