UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ggZWaRBYiIqFxen4Ts2/p447pLTZ14Mpn3qVxVz0XfM=' 
WHERE 
  key_id = '6f6fab0b3c9cec2087f285308787052a38e1b1f8442392b18befee32b4aeb5ae' 
  AND (
    token = 'ggZWaRBYiIqFxen4Ts2/p447pLTZ14Mpn3qVxVz0XfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037