UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NPgqUX2Hdd1UXUsy6BPA+JgZG7gyTIKZcKsov139jAY='
WHERE
key_id = '25cd5035e5680b5f811daf8d0426c525d5087b1e605f771a1129e6a7dc021c58'
AND (
token = 'NPgqUX2Hdd1UXUsy6BPA+JgZG7gyTIKZcKsov139jAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)