UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '19B6dRzK8yQh3dkDT/C+XOm0nCeHfQP3smJuRtWzwPI=' 
WHERE 
  key_id = 'f55e3f79a982e11679e20252f4204006b0af82c07753e885efd953fa2bb7e448' 
  AND (
    token = '19B6dRzK8yQh3dkDT/C+XOm0nCeHfQP3smJuRtWzwPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027