UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a9/A49jjoYZIfrrqCbURCv0PDpwUTOMiAOFa2XimbbM='
WHERE
key_id = '1d3f5e601338ed96c3e756787b25326dc9291b03056c0e08fb5cb57f1caaab53'
AND (
token = 'a9/A49jjoYZIfrrqCbURCv0PDpwUTOMiAOFa2XimbbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)