UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zuTwyRQb52hGrWBp2NVc/aZ07ERfBdZ7XYe3XNqx5ls='
WHERE
key_id = '67f9ed388f1420c04f9a971db2e3204ea923f971f91e054d791f8ff749dd95d3'
AND (
token = 'zuTwyRQb52hGrWBp2NVc/aZ07ERfBdZ7XYe3XNqx5ls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)