UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hYc1ZAqYmgOyqTRcwikLh/jI1iEoeKZdBWLC449S9+8='
WHERE
key_id = '1f601c33fe2a3a4652d3a95b2a05dc5f69dd40f83cb9d991814ab9ba6bccec25'
AND (
token = 'hYc1ZAqYmgOyqTRcwikLh/jI1iEoeKZdBWLC449S9+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)