UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ig+p8ZWh+k6wQYPcX6jsmFDvqKsZ9QuaTKIdLAb8Fz8='
WHERE
key_id = '60e220522fec6f035c272abdb993df6bd481b82ec9e2f3f9f0aa5b02599d2a80'
AND (
token = 'Ig+p8ZWh+k6wQYPcX6jsmFDvqKsZ9QuaTKIdLAb8Fz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)