UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y09vc1HN6lFjjB/FQjR7BUN88KLkam/rlPq/HxKCQzQ='
WHERE
key_id = '088ea3ee23685925bfc6647451a3c3b04435530757f33d4acf062b2367c67b74'
AND (
token = 'y09vc1HN6lFjjB/FQjR7BUN88KLkam/rlPq/HxKCQzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)