UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UE06iRw6vb5RGyGgmH8HMAgppf+v2UaDDunjIrsQEUY='
WHERE
key_id = 'e92e7a74ba4ae9c1d5150184c413bff96b4dfff579664167b0ae66f18331544e'
AND (
token = 'UE06iRw6vb5RGyGgmH8HMAgppf+v2UaDDunjIrsQEUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)