UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2StD5LJbk3rHpO68HVRupbc1LQTbbhVlhy99tRjKbys=' 
WHERE 
  key_id = '16ff333ec2ed342853eeac1ec3d70c08112b40473ad61f93a4ffe8c37f49a3c1' 
  AND (
    token = '2StD5LJbk3rHpO68HVRupbc1LQTbbhVlhy99tRjKbys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026