UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vf+0M13ga2WO+s5VJpGsknbCyLVrd6nXTzDqhp5owPY='
WHERE
key_id = 'df3c59074e7589f2f23de52d0be28e58e880bd9bb9943811b5b64af3da01da0d'
AND (
token = 'vf+0M13ga2WO+s5VJpGsknbCyLVrd6nXTzDqhp5owPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)