UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Axm1qBokFvJmW/M0XWErfBdJ+0ymu5gNv0NpXdiupW0='
WHERE
key_id = 'c730f4ea6a67b39ab58adca95edc72af5b4d819ac9fb4a07608c548f8c7c176c'
AND (
token = 'Axm1qBokFvJmW/M0XWErfBdJ+0ymu5gNv0NpXdiupW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)