UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i4qH2Wmwve+EIK+mai32msuR8gpcmbDOyRsb3mNsMzM=' 
WHERE 
  key_id = '73bd81af51b42b8b899d044ae26a02d8c37b12b04f3919b38bd99a77cd286d18' 
  AND (
    token = 'i4qH2Wmwve+EIK+mai32msuR8gpcmbDOyRsb3mNsMzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028