UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FRLk+DxXs4YjwYxbN6IDFYUso1NK8Qjuttyk9RR8Jhc='
WHERE
key_id = '94ed5b89938e11f699c7b055829d73c181e901d110839ca0252ec0e1c8b6a901'
AND (
token = 'FRLk+DxXs4YjwYxbN6IDFYUso1NK8Qjuttyk9RR8Jhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)