UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6YrHmwHKBAk4Ic1YrI9dKGTeFMA5rF6yu9vJvEFBEZc='
WHERE
key_id = 'bc7a2571e8e8532e60dbdc72b0d955d735dd8e6057abe74161e9e1fb29de2e04'
AND (
token = '6YrHmwHKBAk4Ic1YrI9dKGTeFMA5rF6yu9vJvEFBEZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)