UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y2mp4vkyBhcWETKz0XP6iJEOqlSptQU/d3815RDfBYg='
WHERE
key_id = '4ffb9dcd441566eb323346ac7d6d2cd80a14aadc94f882c96d14d250daca0d6e'
AND (
token = 'y2mp4vkyBhcWETKz0XP6iJEOqlSptQU/d3815RDfBYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)