UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aDtitwKB04Pyv8Gh3DciSO/AkPmmBuNxzvbyXlPPsdA=' 
WHERE 
  key_id = 'afa57c16ff18125685b966325d175ba84065bbf21e36d2777c8ac9d425fb1ed8' 
  AND (
    token = 'aDtitwKB04Pyv8Gh3DciSO/AkPmmBuNxzvbyXlPPsdA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033