UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vqTixI9cZebhTcyb2efVBdXysrOEz1aSr1/Ttn8wfrk=' 
WHERE 
  key_id = '8359a704d2550daefcfec2a22c2574f7cd0cb7898d7fe803ec479df157b13fb8' 
  AND (
    token = 'vqTixI9cZebhTcyb2efVBdXysrOEz1aSr1/Ttn8wfrk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023