UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iNLdsHMu+ylTeFtM+FXjJhjHOr7QgOvBjQph82qbW7U=' 
WHERE 
  key_id = 'ff67d1d59294c7cf121031269fd97f8ece586802f1b94622ab9d69473ce04663' 
  AND (
    token = 'iNLdsHMu+ylTeFtM+FXjJhjHOr7QgOvBjQph82qbW7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039