UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0BOFq5Z27vNK3PWDFxTA50C0T212fnOZnGPIca3PwtY='
WHERE
key_id = '2687315e7ffaf457a7abec69dd7774b99225e62991f0f95b15be6bb64f3ea2f1'
AND (
token = '0BOFq5Z27vNK3PWDFxTA50C0T212fnOZnGPIca3PwtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)