UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '74mpSXfLMPFt0hMl5frj+HFQFmjbdaSmBQYuNs58Aw0='
WHERE
key_id = 'f95700d6397784392f21305bcb6fc3de48dc1fb1d0ba0d87bb4e7ad0240c73ee'
AND (
token = '74mpSXfLMPFt0hMl5frj+HFQFmjbdaSmBQYuNs58Aw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)