UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zQXjTcwPSR9R+0SI2AzFZuuj+oU11UzGjudxbHsaZvM='
WHERE
key_id = 'abe8efde6eabe73ff66c51e81236f5054a579da93a9b19a990935a7e2a92bf74'
AND (
token = 'zQXjTcwPSR9R+0SI2AzFZuuj+oU11UzGjudxbHsaZvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)