UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OECByD0348oW2TGPIiGL0IfEtO/RjQ77n6POKd/4Pck='
WHERE
key_id = '8b64ad47072d39162d9331f4ca749636f751dc5dd11fc01a26ba32d07d3b7e0e'
AND (
token = 'OECByD0348oW2TGPIiGL0IfEtO/RjQ77n6POKd/4Pck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)