UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Hq7L8+v9pthJTVRMZ1z3c8kp3mA7QPgccfrgvWMUdg=' 
WHERE 
  key_id = '2160e443790b994a1f566be53c0493f96d7602bfbe563b85ff1b2d9812990716' 
  AND (
    token = '9Hq7L8+v9pthJTVRMZ1z3c8kp3mA7QPgccfrgvWMUdg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022