UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GQJ9U7rmSse/c0J6n9A3Z5tmkotryPsfKCp5UkDZLKw='
WHERE
key_id = '67502ae516b8d184aa4d8cd6467b30f59f5d875fbc19463dc4653f803dcb7a27'
AND (
token = 'GQJ9U7rmSse/c0J6n9A3Z5tmkotryPsfKCp5UkDZLKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)