UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's6SkscxGblcZDKeGE5DCfCRZE+6rHiQ5ghfpGvlnV5I=' 
WHERE 
  key_id = '462c1f14217eab51650ba4cfeac1bade64e6c92e294ea9d4909593881d31ffff' 
  AND (
    token = 's6SkscxGblcZDKeGE5DCfCRZE+6rHiQ5ghfpGvlnV5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030