UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ceo0pNZCoFb6EMLrKz0e7XxzRM0q5hjOqC9MLaxmoHc=' 
WHERE 
  key_id = 'b744ec4b77bf4e3aadece7f37f59310db3a4f25d6357754b1406984b486c3407' 
  AND (
    token = 'ceo0pNZCoFb6EMLrKz0e7XxzRM0q5hjOqC9MLaxmoHc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031