UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tixLRh8VBh6BzkDHPII2vDrt5m7Kq/OjUEK1z4Mu7N8='
WHERE
key_id = '9ad8cb62a00a2ae48c0c46d1607a84063b24b946d823aa0151e8fdbbd28d5ebc'
AND (
token = 'tixLRh8VBh6BzkDHPII2vDrt5m7Kq/OjUEK1z4Mu7N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)