UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jTk4XyMlFODT4js08+Eh506WAlhPE5ILtLjZW38OqlI='
WHERE
key_id = '906924d07eb9b30336ca23e36f76305e35eec3509d8c472bc2821883db246563'
AND (
token = 'jTk4XyMlFODT4js08+Eh506WAlhPE5ILtLjZW38OqlI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)