UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J/jrK9FTYLxx2mvr20Yy7tgj6Ze12MP3SY+pGuCtj8A='
WHERE
key_id = 'b6314ba6d3006b57dd18d14eadb6b813738e8da781945a0374bd0502d1475d6d'
AND (
token = 'J/jrK9FTYLxx2mvr20Yy7tgj6Ze12MP3SY+pGuCtj8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)