UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k1hGe0j4NJj1pA67kN2XLfGH33z+/A1g9i1JMHu9SAo=' 
WHERE 
  key_id = 'c917c15e3f73aa40fd32a7dd4cbc8c224b020731a039a71682bc776428cdbda1' 
  AND (
    token = 'k1hGe0j4NJj1pA67kN2XLfGH33z+/A1g9i1JMHu9SAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039