UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WHn+Jtdp7RNAq832Q0QHHRZR1qErWKs2l0EPyii+lss='
WHERE
key_id = '3a1cff7ec8c18f7a1e60e1926d863695540f9af54186fbc01b9a6079d7ba5920'
AND (
token = 'WHn+Jtdp7RNAq832Q0QHHRZR1qErWKs2l0EPyii+lss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)