UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GIsdZT9zg0xsexmCoWX7eeaGz3iU+NfyqqY5lS/Ivno='
WHERE
key_id = 'b6b07b7a7a3026dd21ea8dfec9710e85f638cadd53da14fb68259e8861503e3f'
AND (
token = 'GIsdZT9zg0xsexmCoWX7eeaGz3iU+NfyqqY5lS/Ivno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)