UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yJrJmNCTHK1zWWrpJkQ45X+O8HBHIbtLc6hfNC3Ouuc=' 
WHERE 
  key_id = '120aac1778b4fd10da9614c65d51312b0d014e84269d900c3f481e612e3b8b35' 
  AND (
    token = 'yJrJmNCTHK1zWWrpJkQ45X+O8HBHIbtLc6hfNC3Ouuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031