UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CZC70RFKgjdK03hnMAKunuzomZgOYPOQm94hfWfWO44='
WHERE
key_id = 'bb7a37e3f78e408cbd9a4bd59e814cd55a8a14ecf38ac8fd50506c195d74af73'
AND (
token = 'CZC70RFKgjdK03hnMAKunuzomZgOYPOQm94hfWfWO44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)