UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OwqIgFvpnr8AtZ78WsywnAxLtwq3qHqGO+QeLojf6So='
WHERE
key_id = '6410bae5823b44e92f59247e41e70c37223aab2beccf6c03fcbc4790a37dcf9d'
AND (
token = 'OwqIgFvpnr8AtZ78WsywnAxLtwq3qHqGO+QeLojf6So='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)