UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ykpgf+GrSD9seX+aTGxS/JMCHos3sEpA1oJUR4anyzA='
WHERE
key_id = '1b3b5f207406048d2c8111367ae887682bfa8f5d0a209f2cb1ada3228b76bc6b'
AND (
token = 'Ykpgf+GrSD9seX+aTGxS/JMCHos3sEpA1oJUR4anyzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)