UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fI/6Wbwf6E0SGgbx3MEXCoOw5W5eYHLuiIos9UMielw=' 
WHERE 
  key_id = 'da663f35806acddaf57c7c97fc002244701a8c72a720020d1a2bd1f436787bd4' 
  AND (
    token = 'fI/6Wbwf6E0SGgbx3MEXCoOw5W5eYHLuiIos9UMielw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043