UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e3QaxonrEo+kcxWtZ4p+1x5QWNSTagvy4Gw4t8HzMTQ='
WHERE
key_id = '285e3b7deae2ceaadf163d3f8ae53234ff8bc21f4abe3a57b356b5ea661d434a'
AND (
token = 'e3QaxonrEo+kcxWtZ4p+1x5QWNSTagvy4Gw4t8HzMTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)