UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8tWP6VwzWRka4p9VHamJObTMaMEBzlAIFHdA/UbRY+g='
WHERE
key_id = '43446dfc337604349365c1246555e038e3fcffadf8810b0ba11b9fb6f069e709'
AND (
token = '8tWP6VwzWRka4p9VHamJObTMaMEBzlAIFHdA/UbRY+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)